-- GENERATED SPELL FOR [Halfdan the Ice-Hearted] --


function spell0_23671(pUnit, Event) --@Enrage,Self--
pUnit:FullCastSpellOnTarget(8599,pUnit)
pUnit:RegisterEvent('Sorts_23671', 573, 1)
end

function spell1_23671(pUnit, Event) --@Knockdown,n/a--
pUnit:FullCastSpellOnTarget(32015,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23671', 1000, 1)
end

function spell2_23671(pUnit, Event) --@Mortal Strike,n/a--
pUnit:FullCastSpellOnTarget(32736,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23671', 5300, 1)
end

function spell3_23671(pUnit, Event) --@Shield Block,Self--
pUnit:FullCastSpellOnTarget(12169,pUnit)
pUnit:RegisterEvent('Sorts_23671', 5335, 1)
end

function spell4_23671(pUnit, Event) --@Shield Charge,n/a--
pUnit:FullCastSpellOnTarget(19131,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_23671', 617, 1)
end

function Sorts_23671(pUnit, Event)
local choix_sorts_23671 = math.random(0, 4)
if choix_sorts_23671 == 0 then
pUnit:RegisterEvent('spell0_23671', 1, 1)
end
if choix_sorts_23671 == 1 then
pUnit:RegisterEvent('spell1_23671', 1, 1)
end
if choix_sorts_23671 == 2 then
pUnit:RegisterEvent('spell2_23671', 1, 1)
end
if choix_sorts_23671 == 3 then
pUnit:RegisterEvent('spell3_23671', 1, 1)
end
if choix_sorts_23671 == 4 then
pUnit:RegisterEvent('spell4_23671', 1, 1)
end
end

function mob23671_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_23671', math.random(1500, 3000), 1)
end

function mob23671_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23671_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob23671_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(23671, 1, 'mob23671_Action')
RegisterUnitEvent(23671, 2, 'mob23671_Leave')
RegisterUnitEvent(23671, 3, 'mob23671_Kill')
RegisterUnitEvent(23671, 4, 'mob23671_Die')
